import type{MutationTree  , ActionTree , GetterTree} from "vuex";

import type {State} from '@/store'
export interface UserState{
    username:string
    age:number
}

const state:UserState = {
    username:'',
    age:12
 };
const mutations:MutationTree<UserState> = {
    change(state){
        console.log('change')
    }
};
const actions:ActionTree<UserState, State> = {};
const getters:GetterTree<UserState, State> = {
    doubleAge(state){
        return state.age * 2
    }
};

export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}